<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>线性渐变 - 使用透明</title>
    <style type="text/css">
        div {
            width: 800px;
            height: 500px;
            background: -webkit-linear-gradient(90deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 1));
            background: -moz-linear-gradient(90deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 1));
            background: -o-linear-gradient(90deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 1));
            background: linear-gradient(90deg, rgba(255, 0, 0, 0), rgba(255, 0, 0, 1));
        }
    </style>
</head>
<body>
<div></div>
</body>
</html>